<%-- 
    Document   : index
    Created on : 07.04.2014, 14:33:32
    Author     : kgp
--%>

<%@page import="model.MoodleCourse"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:useBean id="courseBean" class="view.MoodleCoursesBean" scope="session"/>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Список дисциплін серверу Moodle</title>
        <link href="${pageContext.request.contextPath}/moodleclient.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
        <h1>Список дисциплін серверу Moodle: ${courseBean.courses.size()}</h1>
        <table>
            <tr>
                <th>ID</th>
                <th>SHORTNAME</th>
                <th>FULLNAME</th>
                <th>SUMMARY</th>
                <th>CATEGORY ID</th>
                <th>FORMAT</th>
                <th>NUM SECTIONS</th>
                <th>LANG</th>
            </tr>
            <c:forEach var="course" items="${courseBean.courses}"> 
                <tr>
                    <td><c:out value="${course.getId()}"></c:out></td>
                    <td><c:out value="${course.getShortname()}"></c:out></td>
                    <td><c:out value="${course.getFullname()}"></c:out></td>
                    <td><c:out value="${course.getSummary()}"></c:out></td>
                    <td><c:out value="${course.getCategoryid()}"></c:out></td>
                    <td><c:out value="${course.getFormat()}"></c:out></td>
                    <td><c:out value="${course.getNumsections()}"></c:out></td>
                    <td><c:out value="${course.getLang()}"></c:out></td>
                </tr>
            </c:forEach> 
        </table>
        <p><a href="index.jsp">На стартовую страницу</a></p>
    </body>
</html>
